package com.physics.mps.module.ansys.controller;

import com.physics.mps.entity.vo.ResponseResult;
import com.physics.mps.entity.vo.StartComputeVo;
import com.physics.mps.module.ansys.service.AnsysService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * @author mcsoft
 * @since 2023/11/1
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/ansys")
public class AnsysController {
    private final AnsysService ansysService;

    @PostMapping(value = "/startCompute")
    public ResponseResult startCompute(@RequestBody @Validated StartComputeVo startComputeVo) throws Exception {
        ansysService.submit(startComputeVo);
        return ResponseResult.success();
    }
}
